package com.weipai.springboot.module.mapper;

import com.weipai.springboot.model.GoodsCollection;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsCollectionMapper {

    //删除取消   商品收藏
    int deleteByPrimaryKey(@Param("customerId") String customerId, @Param("goodsId") String goodsId);

    int insert(GoodsCollection record);

    int insertSelective(GoodsCollection record);

    GoodsCollection selectByPrimaryKey(String collectionId);

    int updateByPrimaryKeySelective(GoodsCollection record);

    int updateByPrimaryKey(GoodsCollection record);

    //查询所有商品的收藏 列表
    List<GoodsCollection> selectAllByGoodsCollection(@Param("customerId")String customerId, @Param("page")Integer page, @Param("size")Integer size);

    int allAdd(String customerId, String[] goodsId);

    //验证是否存在此商品
    List<GoodsCollection> verGoodsCollection(@Param("customerId") String customerId, @Param("goodsId") String goodsId);

    //一键清空 商品收藏
    int deleteByAll(@Param("customerId")String customerId);


    Integer countByAll(@Param("customerId")String customerId);
}